package com.fresh.bus.chat.ctrl;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fresh.bus.canoe.message.Request;
import com.fresh.bus.canoe.message.Response;
import com.fresh.bus.canoe.session.Session;
import com.fresh.bus.canoe.session.SessionRoleManager;
import com.fresh.bus.chat.business.ExperienceService;
import com.fresh.bus.chat.business.FriendService;
import com.fresh.bus.chat.business.LoginService;
import com.fresh.bus.chat.business.MessageService;
import com.fresh.bus.chat.business.ScheduleManager;
import com.fresh.bus.chat.business.SelectService;
import com.fresh.bus.chat.business.TalkService;
import com.fresh.bus.chat.business.TreeService;
import com.fresh.bus.chat.business.UserService;
import com.fresh.bus.chat.business.WealthService;
import com.fresh.bus.chat.business.ZhiFeiJiService;
import com.fresh.bus.chat.util.MessageUtils;

public class BaseCtrl {
	protected static final Logger log = LoggerFactory.getLogger(BaseCtrl.class);
	@Resource
	protected SessionRoleManager roleManager;
	
	@Resource
	protected SelectService selectService;
	@Resource
	protected UserService userService;
	@Resource
	protected LoginService loginService;
	@Resource
	protected TalkService talkService;
	@Resource
	protected MessageService msgService;
	@Resource
	protected ScheduleManager scheduleManager;	
	@Resource
	protected ExperienceService expService;
	@Resource
	protected WealthService wealthService;
	
	@Resource
	protected ZhiFeiJiService feijiService;
	@Resource
	protected FriendService friendService;
	@Resource
	protected TreeService treeService;
	
	@Resource
	protected BusCtrl busCtrl;
	@Resource
	protected ChatCtrl chatCtrl;
	
	protected void reportError(Session session) {
		Response response = new Response(OpCodes.GENERAL_ERROR);
		response.setData(MessageUtils.getErrorMessage());
		session.send(response);
	}
}
